const http = require('http');

http.createServer((req, res) => {
    res.end('Hello world!');
}).listen(3000, () => {
    console.log('127.0.0.1:3000');
});

process.on('SIGTERM', () => {
    console.log('Got a SIGTERM, exiting...');
    process.exit(42);
});

console.log('server running with PID:', process.pid);

setTimeout(() => {
    process.kill(process.pid, 'SIGTERM');
}, 4000);
